import request from '@/utils/request'

// 查询队员队伍列表
export function listMemberTeam(query) {
  return request({
    url: '/match/MemberTeam/list',
    method: 'get',
    params: query
  })
}

// 查询队员队伍详细
export function getMemberTeam(userId) {
  return request({
    url: '/match/MemberTeam/' + userId,
    method: 'get'
  })
}

// 新增队员队伍
export function addMemberTeam(data) {
  return request({
    url: '/match/MemberTeam/add',
    method: 'post',
    data: data
  })
}

// 修改队员队伍
export function updateMemberTeam(data) {
  return request({
    url: '/match/MemberTeam',
    method: 'put',
    data: data
  })
}

// 删除队员队伍
export function delMemberTeam(userId) {
  return request({
    url: '/match/MemberTeam/' + userId,
    method: 'delete'
  })


}
//用户自己退出队伍
export function leaveTeam(teamId) {
  return request({
    url: '/match/MemberTeam/leaveTeam/'+ teamId,
    method: 'delete',
    data: teamId
  })
}

//队长踢出成员
export function removeMember(userName, teamId) {
  return request({
    url: '/match/MemberTeam/removeMember',
    method: 'post',
    params: {
      userName,
      teamId
    }
  })
}
